package com.qixiucoding.exit;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import javax.annotation.PreDestroy;

/**
 * @Description TODO
 * @Author longhj
 * @Date 2022/09/03 星期六 11:16
 */
@Component
public class ExitProgram implements ApplicationRunner {

    @PreDestroy
    public void destory() {
        System.out.println("在程序启动时执行");
    }

    @Override
    public void run(ApplicationArguments args) throws Exception {
        System.out.println("在程序关闭时执行");
    }



}
